<!-- layui -->
{php}$layuiVersion = \yunj\core\Config::get("admin.layui_version", "2.5.5"){/php}
<link rel="stylesheet" href="/static/yunj/libs/layui_{$layuiVersion}/css/layui.css">
<link rel="stylesheet" href="/static/yunj/css/yunj.min.css?v={$Think.YUNJ_VERSION}">
<script src="/static/yunj/libs/layui_{$layuiVersion}/layui.js" charset="utf-8"></script>

<!-- style_file_list -->
<!-- 配置 -->
{php}$pageStyleFileList=yunj_config('admin.style_file_list',[]);{/php}
{foreach $pageStyleFileList as $path }
<link rel="stylesheet" href="{$path}">
{/foreach}
<!-- 页面渲染 -->
{if isset($styleFileList) && is_array($styleFileList)}
{foreach $styleFileList as $path }
<link rel="stylesheet" href="{$path}">
{/foreach}
{/if}

<script type="text/javascript">
    layui.config({
        version: '{$Think.YUNJ_VERSION}',
        base: '',
    }).extend({:\\yunj\\core\\YunjLayui::moduleExtend()});
    window.yunj={};

    window.YUNJ_VERSION='{$Think.YUNJ_VERSION}';
    window.YUNJ_CONFIG={:\\yunj\\core\\YunjExpose::config(true)};
    window.YUNJ_THEME={:\\yunj\\core\\YunjTheme::lists(true)};
    {if isset($yunj_form)&&$yunj_form}window.YUNJ_FORM={:json_encode($yunj_form)};{/if}
    {if isset($yunj_table)&&$yunj_table}window.YUNJ_TABLE={:json_encode($yunj_table)};{/if}
    {if isset($yunj_import)&&$yunj_import}window.YUNJ_IMPORT={:json_encode($yunj_import)};{/if}

    // 监听表单禁止（回车）自动提交
    document.addEventListener('submit', function(event) {
        if (event.target.tagName.toLowerCase() === 'form') {
            event.preventDefault(); // 阻止表单的默认提交行为
        }
    }, false); // 使用冒泡阶段
</script>

<!-- script_file_list -->
<!-- 配置 -->
{php}$pageScriptFileList=yunj_config('admin.script_file_list',[]);{/php}
{foreach $pageScriptFileList as $path }
<script type="text/javascript" src="{$path}" charset="utf-8"></script>
{/foreach}
<!-- 页面渲染 -->
{if isset($scriptFileList) && is_array($scriptFileList)}
{foreach $scriptFileList as $path }
<script type="text/javascript" src="{$path}"></script>
{/foreach}
{/if}